package ioexercise;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class OOSDemo {
    public static void main(String[] args) throws IOException {
        //对象流读写对象---------------Student+OOSDemo+OISDemo
        String name="张三";
        int age=25;
        String gender="男";
        String[] otherInfo={"是一个学生","家住黑龙江黑慕斯"};
        Student zs=new Student(name,age,gender,otherInfo);

        FileOutputStream fos=new FileOutputStream("student0.dat");
        ObjectOutputStream oos=new ObjectOutputStream(fos);
        oos.writeObject(zs);
        oos.close();
        System.out.println("写出完毕");




    }
}
